<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="viewport-fit=cover,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>Ionic Simple Test</title>
    <base href="./">
    
    <!-- 只加载 CSS，不加载 JavaScript -->
    <link href="./ionic/css/chunk-ionic.f5c8e0e3.css" rel="stylesheet">
    <link href="./ionic/css/app.7b141fc5.css" rel="stylesheet">
    
    <style>
        body {
            margin: 0;
            padding: 20px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: #f4f5f8;
        }
        
        .test-container {
            max-width: 400px;
            margin: 0 auto;
            background: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        .ionic-button {
            background: #3880ff;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 4px;
            font-size: 16px;
            margin: 10px 0;
            width: 100%;
            cursor: pointer;
        }
        
        .ionic-input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            margin: 10px 0;
            font-size: 16px;
        }
        
        .status {
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
            background: #d4edda;
            color: #155724;
        }
    </style>
</head>
<body>
    <div class="test-container">
        <h1>Ionic 样式测试</h1>
        <div class="status">✓ HTML 和 CSS 加载成功</div>
        
        <input type="text" class="ionic-input" placeholder="测试输入框" value="这是一个测试">
        <button class="ionic-button" onclick="testClick()">测试按钮</button>
        
        <div id="test-results">
            <p>基础功能测试：</p>
            <ul>
                <li>✓ HTML 结构正常</li>
                <li>✓ CSS 样式加载</li>
                <li id="js-test">⏳ JavaScript 测试中...</li>
            </ul>
        </div>
        
        <div id="resource-test">
            <p>资源加载测试：</p>
            <div id="css-test">⏳ 检测 CSS 文件...</div>
            <div id="img-test">⏳ 检测图片资源...</div>
        </div>
    </div>
    
    <script>
        console.log('Ionic simple test page loaded');
        
        function testClick() {
            alert('按钮点击测试成功！');
            document.getElementById('js-test').innerHTML = '✓ JavaScript 执行正常';
        }
        
        // 测试 CSS 是否真正加载
        function testCSS() {
            const testElement = document.createElement('div');
            testElement.style.display = 'none';
            testElement.className = 'ion-color-primary'; // Ionic CSS 类
            document.body.appendChild(testElement);
            
            const styles = window.getComputedStyle(testElement);
            const hasIonicStyles = styles.getPropertyValue('--ion-color-primary') !== '';
            
            document.getElementById('css-test').innerHTML = hasIonicStyles ? 
                '✓ Ionic CSS 变量可用' : '⚠ Ionic CSS 变量不可用';
            
            document.body.removeChild(testElement);
        }
        
        // 测试图片资源
        function testImage() {
            const img = new Image();
            img.onload = () => {
                document.getElementById('img-test').innerHTML = '✓ 图片资源可访问';
            };
            img.onerror = () => {
                document.getElementById('img-test').innerHTML = '✗ 图片资源不可访问';
            };
            img.src = './ionic/assets/icon/favicon.png';
        }
        
        // 页面加载完成后运行测试
        window.onload = function() {
            document.getElementById('js-test').innerHTML = '✓ JavaScript 执行正常';
            testCSS();
            testImage();
        };
    </script>
</body>
</html>